<template>
	<view class="box">
		<!--  -->
		<view class="box1">
			<view class="box11">
				<image src="../../static/image/mein.jpg" mode=""></image>
			</view>
			<view class="box12">
				<view class="box121">师傅名称</view>
				<view class="box122">上门时间: 2021-11-18 14:35:12</view>
			</view>
		</view>
		<!--  -->
		<view class="box2">
			<view class="">点击星星评分</view>
			<view class="box21">
				<uv-rate :count="count" v-model="value" active-color="#cf2d22" inactive-color="#cccccc" size="80rpx"></uv-rate>
			</view>
		</view>
		<!--  -->
		<view class="box3">
			<textarea value="" v-model="text" placeholder="请输入..." />
			<view class="box31">
				<image src="/static/image/xj.png" mode=""></image>
			</view>
		</view>
		<!--  -->
		<view class="box4">
			<button class="btn" @click="AddEvaluation">确认提交</button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import {
		myRequest
	} from '@/request/request.js'
	import {
		onLoad
	} from '@dcloudio/uni-app';
	import {

		computed
	} from 'vue';
	onLoad((e) => {
		 name1.value = e.name
		// console.log( name1.value);
	})
	// 获取地址栏传参
	const name1 = ref('')
	// 添加师傅评价
	const AddEvaluation = () => {
		const id1 = name1.value
		const id = id1.replace(/\"/g, "");
		console.log(id,value,text);
		myRequest('apa/add?server=1', function(err, data) {
			if (err) {
				// console.log(err);
				uni.showToast({
					title: err,
				});
			} else {
				// console.log(text.value);
				console.log("成功", data);
			}
		}, 'POST', {
			assess: value.value,
			master_id: id,
			text: text.value,
			images: '#'
		})
	}
	const text = ref('')

	const count = ref('5')
	const value = ref('3')
</script>

<style lang="scss">
	@import url("lijipingj.scss");
</style>